package org.ziwei.paipan.biao;

import org.ziwei.paipan.var.DiZhi;

/**
 * 流年斗君表
 * 流年斗君位置 即為以子年斗君位置為起點，以順時針方向，依子、丑、寅.......戌、亥次序，屬至流年地支。
 * 如某女士的子年斗君位於酉宮，西元2012年陰曆過年後為壬辰年，流年地支為辰。故在命盤上以酉宮為起點，依順時針方向，往前數子、丑、寅...辰共5個宮位。故知流年斗君位置在丑宮。驗證結果是與查表法相同的。 
 */
public class LiuNianDouJunBiao {
	
	/**
	 * 流年斗君表
	 * 横轴流年地支，纵轴为子年斗君
	 */
	private static DiZhi[][] liuNianDouJunBiao = {
			{DiZhi.ZI,DiZhi.CHOU,DiZhi.YIN,DiZhi.MAO,DiZhi.CHEN,DiZhi.SI,DiZhi.WU,DiZhi.WEI,DiZhi.SHEN,DiZhi.YOU,DiZhi.XU,DiZhi.HAI},
			{DiZhi.CHOU,DiZhi.YIN,DiZhi.MAO,DiZhi.CHEN,DiZhi.SI,DiZhi.WU,DiZhi.WEI,DiZhi.SHEN,DiZhi.YOU,DiZhi.XU,DiZhi.HAI,DiZhi.ZI},
			{DiZhi.YIN,DiZhi.MAO,DiZhi.CHEN,DiZhi.SI,DiZhi.WU,DiZhi.WEI,DiZhi.SHEN,DiZhi.YOU,DiZhi.XU,DiZhi.HAI,DiZhi.ZI,DiZhi.CHOU},
			{DiZhi.MAO,DiZhi.CHEN,DiZhi.SI,DiZhi.WU,DiZhi.WEI,DiZhi.SHEN,DiZhi.YOU,DiZhi.XU,DiZhi.HAI,DiZhi.ZI,DiZhi.CHOU,DiZhi.YIN},
			{DiZhi.CHEN,DiZhi.SI,DiZhi.WU,DiZhi.WEI,DiZhi.SHEN,DiZhi.YOU,DiZhi.XU,DiZhi.HAI,DiZhi.ZI,DiZhi.CHOU,DiZhi.YIN,DiZhi.MAO},
			{DiZhi.SI,DiZhi.WU,DiZhi.WEI,DiZhi.SHEN,DiZhi.YOU,DiZhi.XU,DiZhi.HAI,DiZhi.ZI,DiZhi.CHOU,D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